﻿Public Class frmSQLCaptureConfig
    Private _SQLCapture As TCaptureMyProcessList

    Public Sub ShowEx(ByVal ASQLCapture As TCaptureMyProcessList)
        _SQLCapture = ASQLCapture
        txtSpan.Value = ASQLCapture.CaptureSpan
        If ASQLCapture.DatabaseType = TCaptureMyProcessList.TDatabaseType.dtFile Then
            optFile.Checked = True
        Else
            optInMemory.Checked = True
        End If
        Me.ShowDialog()
    End Sub

    Private Sub cmdCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCancel.Click
        Me.Close()
    End Sub

    Private Sub cmdOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOK.Click
        _SQLCapture.CaptureSpan = txtSpan.Value
        If optFile.Checked Then
            _SQLCapture.DatabaseType = TCaptureMyProcessList.TDatabaseType.dtFile
        Else
            _SQLCapture.DatabaseType = TCaptureMyProcessList.TDatabaseType.dtInMemory
        End If

        MsgBox("変更はプログラムの再起動後に反映されます。", MsgBoxStyle.Information)
        Me.Close()
    End Sub
End Class